package com.hthy.futures.ui.activity;

import android.os.Build;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.hthy.futures.R;
import com.hthy.futures.base.BaseActivity;
import com.hthy.futures.view.TitleView;

import butterknife.Bind;

/**
   *
   * Author:  Mr.bingley
   * Version:
   * Date:  2017/5/8
   */

public class PullPayActivity extends BaseActivity{
    @Bind(R.id.webview)
    WebView mWebView;

    @Bind(R.id.iv_toolbar_left)
    ImageView mLeftimg;
    @Override
    protected int getContentView() {
        return R.layout.act_pull;
    }

    @Override
    protected void initWidget() {
        super.initWidget();
        String url = getIntent().getExtras().getString(getString(R.string.pullurl));

        WebSettings webSettings=mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING);
        } else {
            webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
        }
        mWebView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });

        if (url != null) {
            mWebView.loadUrl(url);
        }


        mLeftimg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }


}
